package com.tiantian.lianhui.boot.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tiantian.lianhui.api.domain.req.*;
import com.tiantian.lianhui.api.domain.resp.ShortLinkBatchCreateRespDTO;
import com.tiantian.lianhui.api.domain.resp.ShortLinkGroupCountQueryRespDTO;
import com.tiantian.lianhui.api.domain.resp.ShortLinkCreateRespDTO;
import com.tiantian.lianhui.api.domain.entity.ShortLinkDO;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.util.List;

/**
 * 短链接接口层
 */
public interface ShortLinkService extends IService<ShortLinkDO> {

    /**
     * 创建短链接
     *
     * @param requestParam 创建短链接请求参数
     * @return 短链接创建信息
     */
    ShortLinkCreateRespDTO createShortLink(ShortLinkCreateReqDTO requestParam);


    IPage<ShortLinkPageRespDTO> pageShortLink(ShortLinkPageReqDTO requestParam);

    List<ShortLinkGroupCountQueryRespDTO> listGroupShortLinkCount(List<String> requestParam);

    void updateShortLink(ShortLinkUpdateReqDTO requestParam);

    void restoreUrl(String shortUri, HttpServletRequest request, HttpServletResponse response);

    void deleteShortLink(List<String> shortLink);

    ShortLinkBatchCreateRespDTO batchCreateShortLink(ShortLinkBatchCreateReqDTO requestParam);
}